
function f_plot_heatmap(Num_Channel,input,C_min,C_max,ifnumber)
d=0:1:100;
Generate_EEG_head_map
map31 = Emap(1:Num_Channel,:);

x = map31(:,1);
y = map31(:,2);
if C_min > C_max % means just the channel names
    for i = 1:Num_Channel
        hold on;
        s=plot(x,y,'ko');
        %         set(s,'markersize',18)
        set(s,'markersize',12)
                tt=text(x(i),y(i),EEGnames{i});
                set(tt,'HorizontalAlignment','center','fontsize',8)
    end
else
    
    if C_min == C_max % means auto
        C_min = min(min(input));
        C_max =max(max(input));
    end
    
    v = input;
    [xq,yq] = meshgrid(d,d);
    vq = griddata(x,y,v,xq,yq);
    s=contourf(d,d,vq,100,'edgecolor','none');
    axis square
    axis off;
    caxis([C_min C_max])
    if ifnumber==1
        for i = 1:Num_Channel
            hold on;
%             tt=text(x(i),y(i),num2str(i));
            tt=text(x(i),y(i),EEGnames{i});
            set(tt,'HorizontalAlignment','center','fontsize',8)
        end
    end
end


return
